﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArticleManager.DataClasses
{
    public class Keyword
    {
        private int key_id;
        private string key_text;

        public override string ToString()
        {
            return this.key_text;
        }

        #region propertiese
        public Keyword()
        {
            key_id = 0;
            key_text = string.Empty;
        }

        public Keyword(int keyid, string keytext)
        {
            key_id = keyid;
            key_text = keytext;
        }

        public string KeyText
        {
            get
            {
                return this.key_text;
            }
            set
            {
                //bool changed = !object.Equals(this._UnreadCount, value);
                this.key_text = value;
                //if (changed) OnPropertyChanged(new PropertyChangedEventArgs(Properties.UnreadCount));

            }
        }

        public int KeyId
        {
            get
            {
                return this.key_id;
            }
            set
            {
                //bool changed = !object.Equals(this._UnreadCount, value);
                this.key_id = value;
                //if (changed) OnPropertyChanged(new PropertyChangedEventArgs(Properties.UnreadCount));

            }
        }


        #endregion

        public class Properties
        {
            public const string KeyId = "id";
            public const string KeyText = "key_text";
        }

    }

    public class KeywordsCollection : System.Collections.CollectionBase
    {
        public int Add(Keyword value)
        {
            return base.List.Add(value as object);
        }

        public void Remove(Keyword value)
        {
            base.List.Remove(value as object);
        }

        public void Insert(int index, Keyword value)
        {
            base.List.Insert(index, value as object);
        }

        public bool Contains(Keyword value)
        {
            return base.List.Contains(value as object);
        }

        public Keyword this[int index]
        {
            get { return base.List[index] as Keyword; }
        }
    }


}
